// 测试枚举序列化
import com.fasterxml.jackson.databind.ObjectMapper;
import com.stillalive.springbootbooksystem.Model.Result;
import com.stillalive.springbootbooksystem.enums.ResultCodeEnum;

public class TestEnumSerialization {
    public static void main(String[] args) throws Exception {
        ObjectMapper objectMapper = new ObjectMapper();
        
        // 创建Result对象
        Result<String> result = Result.success("test data");
        
        // 序列化为JSON
        String json = objectMapper.writeValueAsString(result);
        System.out.println("序列化结果: " + json);
        
        // 直接序列化枚举
        String enumJson = objectMapper.writeValueAsString(ResultCodeEnum.SUCCESS);
        System.out.println("枚举序列化结果: " + enumJson);
    }
}